Learn R Programming

MXM (version 0.9.5)

ROC and area under the curve: ROC and area under the curve

Description

Receiver operating curve and area under the curve.

Usage

auc(group, preds, roc = FALSE, cutoffs = NULL)

Arguments

group
The true labels, either a factor or a numerical vector with two numbers only.
preds
The predicted values of each group.
roc
If you want the ROC to appear set it to TRUE.
cutoffs
If you provide a vector with decreasing numbers from 1 to 0 that will be used for the ROC, otherwise, the values from 1 to 0 with a step equal to -0.01 will be used.

Value

If the roc is set to FALSE, the area under the curve is returned only. Otherwise a list including If the roc is set to FALSE, the area under the curve is returned only. Otherwise a list including

Details

The ara under the curve is returned. The user has the option of getting the receiver operating curve as well.

See Also

SES, MMPC, testIndLogistic

Examples

Run this code
# simulate a dataset with continuous data
g <- rbinom(150, 1, 0.6)
f <- rnorm(150)
auc(g, f, roc = TRUE)

Run the code above in your browser using DataLab